QuickTime 4 API Documentation

Inside Macintosh: QuickTime Components

Previous | Overview | Contents | Next |

Indirect Functions

This section describes functions that are invoked by the Image Compression Manager but do not correspond to functions called by applications. The Image Compression Manager may call these functions at any time.

ImageCodecPreCompress

Your component receives the ImageCodecPreCompress request before compressing an image or a band of an image. The Image Compression Manager also calls this function when processing a sequence. In that case, the Image Compression Manager calls this function whenever the parameters governing the sequence operation have changed substantially. Your component indicates whether it can perform the requested compression operation.

pascal ComponentResult ImageCodec PreCompress
       (ComponentInstance ci, CodecCompressParams *params);
ci
Specifies the component instance of the image decompressor component

params
Contains a pointer to a compression parameters structure. The Image Compression Manager places the appropriate parameter information in that structure. See "The Compression Parameters Structure," for details.

DESCRIPTION

Your component should return a 0 result code to indicate that it can handle the request. In addition, your component indicates any limitations on its capabilities in a compressor capability structure (see "The Compressor Capability Structure," for details). Your component should return a result code of codecConditionError if it cannot field the compression request.

Only compressors receive this request.

RESULT CODES

noErr

0

No error

paramErr

-50

Invalid parameter specified

codecConditionErr

-8972

Component cannot perform requested operation

ImageCodecBandCompress

Your component receives the ImageCodecBandCompress request to compress an image or a band of an image. The image may be part of a sequence.

pascal ComponentResult ImageCodec BandCompress
       (ComponentInstance ci, CodecCompressParams *params);
ci
Specifies the component instance of the image decompressor component

params
Contains a pointer to a compression parameters structure. The Image Compression Manager places the appropriate parameter information in that structure. See "The Compression Parameters Structure," for a complete description of the compression parameters structure.

DESCRIPTION

Only compressors receive this request.

RESULT CODES

noErr

0

No error

paramErr

-50

Invalid parameter specified

codecSpoolErr

-8966

Error loading or unloading data

codecAbortErr

-8967

Operation aborted by the progress function

ImageCodecPreDecompress

Your component receives the ImageCodecPreDecompress request before decompressing an image or a band of an image. The Image Compression Manager also calls this function when processing a sequence. In that case, the Image Compression Manager calls this function whenever the parameters governing the sequence operation have changed substantially. Your component indicates whether it can perform the requested decompression operation.

pascal ComponentResult ImageCodec PreDecompress
       (ComponentInstance ci, CodecDecompressParams *params);
ci
Specifies the component instance of the image decompressor component

params
Contains a pointer to a decompression parameters structure. The Image Compression Manager places the appropriate parameter information in that structure. See "The Decompression Parameters Structure," for a complete description of the decompression parameters structure.

DESCRIPTION

Your component should return a 0 result code to indicate that it can handle the request. In addition, your component indicates any limitations on its capabilities in a compressor capability structure (see The Compressor Capability Structure for a description of that structure).

If your decompressor component supports scheduled asynchronous decompression operations, be sure to set the codecCanAsyncWhen flag to 1 in the flags field of your component's compressor capabilities structure. If you set codecCanAsyncWhen you must also set codecCanAsync . Codecs that support scheduled asynchronous decompression are strongly advised to also set the codecCanShieldCursor flag.

If your decompressor component uses a secondary hardware buffer for its images, be sure to set the codecHasVolatileBuffer flag to 1 in the flags field of your component's compressor capabilities structure.

If your decompressor component is used solely as a transfer codec and uses the ImageCodecNewImageBufferMemory call to create an offscreen buffer that is really onscreen, your codec will need to set the codecImageBufferIsOnScreen flag to 1.

Only decompressors receive this request.

RESULT CODES

noErr

0

No error

paramErr

-50

Invalid parameter specified

codecConditionErr

-8972

Component cannot perform requested operation

ImageCodecBandDecompress

Your component receives the ImageCodecBandDecompress request to decompress an image or a band of an image. The image may be part of a sequence.

pascal ComponentResult ImageCodec BandDecompress
       (ComponentInstance ci, CodecDecompressParams *params);
ci
Specifies the component instance of the image decompressor component

params
Contains a pointer to a decompression parameters structure. The Image Compression Manager places the appropriate parameter information in that structure. See "The Decompression Parameters Structure," for a complete description of the decompression parameters structure.

DESCRIPTION

For scheduled asynchronous decompression operations, the Image Compression Manager supplies a reference to an ICMFrameTime structure in this function's decompression parameters structure parameter. The ICMFrameTime structure contains time information governing the scheduled decompression operation, including the time at which the frame must be displayed. For synchronous or immediate asynchronous decompress operations, the frame time is set to nil .

When your component has finished the decompression operation, it must call the completion function. In the past, for asynchronous operations, your component called that function directly. For scheduled asynchronous decompression operations, your component should call the Image Compression Manager's ICMDecompressComplete function.

If your component set the codecCanAsyncWhen flag in pre-decompress but cannot support scheduled asynchronous decompression for a given frame, it must return an error code of codecCantWhenErr . If your component's queue is full, it should return an error code of codecCantQueueErr .

Only decompressors receive these requests.

RESULT CODES

noErr

0

No error

paramErr

-50

Invalid parameter specified

codecSpoolErr

-8966

Error loading or unloading data

codecAbortErr

-8967

Operation aborted by the progress function


© 1999 Apple Computer, Inc.

Previous | Overview | Contents | Next